package com.atguigu.day08.bean.test03;

public class Test03 {
    public static void main(String[] args) {
        MyDate m1 = new MyDate(1900,1,1);
        System.out.println("日期:"+m1.getYear()+"年"+m1.getMonth()+"月"+m1.getDay()+"日");
        if (m1.isLeapYear()){
            System.out.println(m1.getYear()+"年是闰年");

        }
        else
            System.out.println(m1.getYear()+"年不是闰年");
    }
}
class MyDate{
    private int year;
    private int month;
    private int day;

    public MyDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }
    void showDate(){
        System.out.println(year+"年"+month+"月"+day+"日");
    }
    boolean isLeapYear(){
        if (year%4==0&&year%100!=0||year%400==0)
            return true;
        else
            return false;
    }
}
